package com.itheima.item.domain.dto;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.item.domain.po.Goods;
import lombok.Data;

@Data
public class GoodsQueryDTO {
    private Integer pageNum=1;
    private Integer pageSize=10;
    private String goodsName;
    private Integer price;
    private Integer sales;
    private Integer status;

    public <T> Page<T> toMpPage(){
        Page<T> page = Page.of(pageNum, pageSize);
        page.addOrder(OrderItem.desc("price"));
        return page;
    }

}
